﻿using ASmile.Com;
using ASmile.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASmile.Win.DaBLL
{
    class PrintConfigBLL : BLLCrud<Sys_PrintConfig>, IPrintConfigBLL
    {
        //public string SearchForm { get; internal set; }

        protected override string ControllerName => "SysManage/PrintConfig";

        /// <summary>
        /// 获取指定窗体的打印配置(缓存获取)
        /// </summary>
        public ApiResult<Sys_PrintConfig> GetPrintConfig(string formName, int printIndex = 0)
        {
            //{ "formName":"窗体全称",printIndex:打印索引，默认0}
            return GetResult<Sys_PrintConfig>(new { formName, printIndex });
        }

        /// <summary>
        /// 获取指定窗体的打印配置(当前用户有效)
        /// {"formName":"窗体全称"}
        /// </summary>
        public ApiResultList<Sys_PrintConfig> GetPrintConfigs(string formName)
        {
            return GetResultList<Sys_PrintConfig>(new { formName });
        }
    }
}